<html>
<head>
<meta name="layout" content="default" />
<!-- <gj:avascript library="vendor/backbone/localStorage/backbone.localStorage" />  -->
</head>
<body>
	<div id="login-register-page">
		<h1>Sign in or Register</h1>
		Email : <br /> <input type="text" name="email"> <br /> <input type="button"
			id="signOnButton" value="Sign on"> <input type="button" id="registerButton"
			value="Register">

		<p id="signOnMessage" style="color: red; font-weight: bold">Please sign on or register before
			proceeding.</p>
		<hr />
	</div>

	<div id="jobsites-page" style='display: none;'>
		<a href='#' class='logout'>Logout</a> <a href="#" class="updateAllJobSites">Update All</a>
		<table id='reviewedJobPagesContainer'></table>

		<table id='jobPages'></table>
		<a href="#" class="addJobPage">Add</a>
	</div>

	<g:javascript>
	var authenticatedOnInit = ${session.user ? true : false };
	$(function() {
	  var appRouter = new com.mahees.jobTracker.ApplicationRouter;
	  Backbone.history.start();
	}); 
	</g:javascript>
	<g:javascript library="default/application" />

	<script type="text/template" id="item-template">
		<td><input type="text" name="name" value="<?= name ?>" placeholder="Ubuntu Careers" /></td>
		<td><input type="text" name="pageUrl" value="<?= pageUrl ?>" placeholder="http://www.ubuntu.com/" /></td>
		<td><input type="text" name="description" value="<?= description ?>" placeholder="IT Careers at Canonical" /></td>
		<td>
			<input type="submit" class='deleteJobSite' value="Delete" />
			<input type="submit" class='saveJobSite' value="Save" />
		</td>
    </script>
    
    <script type="text/template" id="item-readonly-template">
		<td><a href="<?= pageUrl ?>" ><?= name ?></a></td>
		<td><?= description ?></td>
		<td><?= pageLastChanged ?></td>
		<td><?= added ?></td>
		<td><?= removed ?></td>
    </script>

	<script type="text/template" id="error-item-template">
		<li>
			Field: <?= field ?>
			Message: <?= defaultMessage ?>
			Rejected Value: <?= rejectedValue ?>
		</li>
    </script>

	<script type="text/template" id="job-page-table-header-static-template">
		<tr>
			<th>Name</th>
			<th>URL</th>
			<th>Description</th>
			<th> &nbsp;</th>
		</tr>
    </script>
    
    <script type="text/template" id="job-page-readonly-table-header-static-template">
		<tr>
			<th>Name</th>
			<th>Description</th>
			<th>Site Last Updated</th>
			<th>Added</th>
			<th>Removed</th>
		</tr>
    </script>

</body>
</html>